package com.lago.homework3;

import java.util.Scanner;

public class Exercise1 {
    public static void main(String[] args) {
        int lowCount = 0, upperCount = 0, numCount = 0, otherCount = 0;
        System.out.println("请输入您的字符串：");
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] chars = str.toCharArray();
        for (int i = 0; i<chars.length;i++){
            if (chars[i] <= 122 && chars[i] >= 97){
                lowCount++;
            }
            else if (chars[i] >= 65 && chars[i] <= 90){
                upperCount++;
            }
            else if (chars[i] >= 48 && chars[i] <= 57){
                numCount++;
            }
            else {
                otherCount++;
            }
        }
        System.out.println("小写字母的个数为：" + lowCount);
        System.out.println("大写字母的个数为：" + upperCount);
        System.out.println("数组的个数为：" + numCount);
        System.out.println("其他字符的个数为：" + otherCount);
    }
}
